package com.example.movie.mate.controller;

import com.example.movie.mate.pojo.vo.SeatVO;
import com.example.movie.mate.service.ISeatService;
import com.example.movie.mate.web.JsonResult;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 座位控制器
 */
@Tag(name = "4. 影厅座位管理模块")
@RestController
@RequestMapping("/api/seat")
public class SeatController {

    @Autowired
    private ISeatService seatService;

    @ApiOperationSupport(order = 420)
    @Operation(summary = "[游客] 查询影厅座位列表")
    @Parameter(name = "hallId", description = "影厅id", required = true, example = "1")
    @GetMapping("/public")
    public JsonResult<List<SeatVO>> selectByHallId(Long hallId) {
        List<SeatVO> list = seatService.selectByHallId(hallId);
        return JsonResult.ok(list);
    }

}